cmake_minimum_required (VERSION 3.5)

project(3DFolderBrowser)

if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
    option(MYPLATFORM_WIN "MYPLATFORM_WIN" ON)
else()
    option(MYPLATFORM_WIN "MYPLATFORM_WIN" OFF)
endif()

if ( CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Release") )
    option(MYBUILD_TYPE_DEBUG "MYBUILD_TYPE_DEBUG" OFF)
    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -O3")    
    message("====release======" ${CMAKE_BUILD_TYPE})
else()
    option(MYBUILD_TYPE_DEBUG "MYBUILD_TYPE_DEBUG" ON)
    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -O0")
    message("====debug======" ${CMAKE_BUILD_TYPE})
endif()

IF(${MYPLATFORM_WIN})
include("win.cmake")
ELSE()
ENDIF()

# compile
# mkdir build
# cd build
# cmake ..
# "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" SmallEngine.sln /project SmallEngine.vcxproj /Build Release /Out log.txt
## "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" SmallEngine.sln /project INSTALL.vcxproj /Deploy Release /Out log.txt